# 服务端
message(STATUS "Building server...")
set(SERVER_BASE_SOURCES server_base.cpp)
add_library(server_base STATIC ${SERVER_BASE_SOURCES})
target_link_libraries(server_base PUBLIC
    grpc_proto_object
    ${_PROTOBUF_LIBPROTOBUF}
    ${_GRPC_GRPCPP}
    Threads::Threads)
target_include_directories(server_base PUBLIC
    "${PROTO_OUTPUT_DIR}")

if (BUILD_SERVER)
    set(SERVER_SOURCES server.cpp)
    add_executable(server ${SERVER_SOURCES})
    target_link_libraries(server PRIVATE
        server_base)
    install(TARGETS server RUNTIME DESTINATION bin)
endif()
